import { createStore } from 'vuex'
// const screenWidth=window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
import  Axios  from 'axios'

export default createStore({
  state: {
    URL:'http://localhost:1338/',
    screenWidth:1200,
    extraData:[]

  },
  getters: {
  },
  //mutations进入网页就抓取到数据
  mutations: {
    extraFun(state){
      Axios.get(state.URL+'users/getMsgObj').then(rs=>{
        let arr=rs.data;
        state.extraData=arr;
        
      })
    }
  },
  actions: {
  },
  modules: {
  }
})
